<?php

	error_reporting(1);

	$movtypes	= array("mov","avi","mpg","mpeg","divx","ogm","mp4","mkv","m4v","mp4v");	// What are movie file extensions
	$startdir	= getcwd();

	$forcexml		= false;											// Force creation of XML files, even if already existing
	$forcecover		= false;											// Force creation of cover files, even if already existing
	$repaircover	= false;											// Repair cover symlinks (unlink + new symlink)
	$getsubs		= false;											// Get subtitles for the movies

	if(isset($argv[1])){ // File is given
		$movfile = substr($argv[1], strrpos($argv[1], "/")+1);
		$movdir  = substr($argv[1], 0, strrpos($argv[1], "/"));
		$ext = strtolower(substr($movfile, strrpos($movfile, ".")+1));

		// XML Data file
		if(file_exists(str_replace($ext,"xml",$argv[1]))){
			echo "1";
		}else{
			echo "3";
		}

		// JPG Cover file
		if(file_exists(str_replace($ext,"jpg",$argv[1]))){
			echo "1";
		}else{
			echo "3";
		}

		// Subtitles
		if((file_exists(str_replace($ext,"srt",$argv[1]))) or (file_exists(str_replace($ext,"sub",$argv[1])))){
			echo "1";
		}else{
			echo "3";
		}


		exit;
	}
?>